home *** CD-ROM | disk | FTP | other *** search
/ Virtual Sex Shoot / Virtual Sex Shoot.iso / mac / Virtual Sex Shoot / Virtual Sex Shoot.DXR / 00358.ls < prev    next >
Encoding:
Text File  |  1995-09-24  |  9.6 KB  |  331 lines

  1. global gPathName, gLastTimeRollover, gPanoFrame, gPanoCallBackFactory, gTestCallbackFactory, gNavMovieObj, gPanoMovieObj, gLastPanoMovieData, gVRSprite1, gVRSprite2, gVR, gIntroVR, gVR.PanoFilename, gVR.CurrentNodeID, gVR.CurrentHotSpotID, gVR.MouseOverHandler.Message, gVR.RolloverHotSpotHandler.Message, gVR.MouseDownHandler.Message, gVR.PanZoomStartHandler.Message, gVR.MouseStillDownHandler.Message, gVR.NodeLeaveHandler.Message
  2.  
  3. on StartMovieVR256
  4.   set gPathName to EMPTY
  5.   set gLastTimeRollover to 0
  6.   set gPanoFrame to EMPTY
  7.   set gVRSprite1 to 3
  8.   set gVRSprite2 to 4
  9.   set gVR.PanoFilename to gIntroVR
  10.   openXLib("QTVRW.QTC")
  11.   set tInitObj to qtvrw(mnew, "Nav")
  12.   if objectp(tInitObj) then
  13.     tInitObj(mdispose)
  14.   end if
  15.   set gPanoCallBackFactory to SampleCallbacks(mnew)
  16.   set gTestCallbackFactory to TestCallbacks(mnew)
  17. end
  18.  
  19. on StartMovieVR256a
  20.   openXLib("QTVRW.QTC")
  21.   set tInitObj to qtvrw(mnew, "Nav")
  22.   if objectp(tInitObj) then
  23.     tInitObj(mdispose)
  24.   end if
  25.   set gPanoCallBackFactory to SampleCallbacks(mnew)
  26.   set gTestCallbackFactory to TestCallbacks(mnew)
  27. end
  28.  
  29. on StopMovieVR256
  30.   ClosePanoMovie()
  31.   CloseNavMovie()
  32.   closeXLib("QTVRW.QTC")
  33.   if objectp(gPanoCallBackFactory) then
  34.     gPanoCallBackFactory(mdispose)
  35.   end if
  36.   if objectp(gTestCallbackFactory) then
  37.     gTestCallbackFactory(mdispose)
  38.   end if
  39. end
  40.  
  41. on OpenNavMovie256 pFilename, pSpriteNum, pShowOnOpen
  42.   CloseNavMovie()
  43.   set gNavMovieObj to qtvrw(mnew, "Nav")
  44.   if not objectp(gNavMovieObj) then
  45.     put "Unable to create new Nav instance"
  46.     beep()
  47.     exit
  48.   end if
  49.   set spriteLeft to the left of sprite pSpriteNum
  50.   set spriteTop to the top of sprite pSpriteNum
  51.   set tResultCode to gNavMovieObj(mOpenMovie, pFilename, spriteLeft & "," & spriteTop)
  52.   if tResultCode = 0 then
  53.     put "Unable to open navmovie"
  54.     gNavMovieObj(mdispose)
  55.     beep()
  56.     exit
  57.   end if
  58.   if pShowOnOpen then
  59.     gNavMovieObj(mUpdate)
  60.   end if
  61. end
  62.  
  63. on ShowNavMovie256
  64.   if objectp(gNavMovieObj) then
  65.     gNavMovieObj(mUpdate)
  66.   end if
  67. end
  68.  
  69. on SetNavMovieView256 pHPan, pVPan
  70.   if objectp(gNavMovieObj) then
  71.     gNavMovieObj(mSetHPanAngle, string(pHPan))
  72.     gNavMovieObj(mSetVPanAngle, string(pVPan))
  73.   end if
  74. end
  75.  
  76. on CloseNavMovie256
  77.   if objectp(gNavMovieObj) then
  78.     gNavMovieObj(mdispose)
  79.   end if
  80. end
  81.  
  82. on NavFrameScript256 pSpriteNum
  83.   if objectp(gNavMovieObj) then
  84.     if rollOver(pSpriteNum) then
  85.       gNavMovieObj(mMouseOver)
  86.       cursor(200)
  87.       cursor(-1)
  88.     else
  89.       gNavMovieObj(mIdle)
  90.     end if
  91.   end if
  92. end
  93.  
  94. on OpenPanoMovie256 pFilename, pSpriteNum, pShowOnOpen
  95.   put pFilename, pSpriteNum, pShowOnOpen
  96.   ClosePanoMovie()
  97.   set gPanoMovieObj to qtvrw(mnew, "Pan")
  98.   if not objectp(gPanoMovieObj) then
  99.     put "Unable to create new Pan instance"
  100.     beep()
  101.     exit
  102.   end if
  103.   set spriteLeft to the left of sprite pSpriteNum
  104.   set spriteTop to the top of sprite pSpriteNum
  105.   set tResultCode to gPanoMovieObj(mOpenMovie, pFilename, spriteLeft & "," & spriteTop)
  106.   if tResultCode = 0 then
  107.     put "Unable to open panomovie"
  108.     gPanoMovieObj(mdispose)
  109.     beep()
  110.     exit
  111.   end if
  112.   set gPathName to ExtractPathName(pFilename)
  113.   InitPanoCallbacks()
  114.   if pShowOnOpen then
  115.     gPanoMovieObj(mUpdate)
  116.   end if
  117. end
  118.  
  119. on InitPanoCallbacks256
  120.   if objectp(gPanoMovieObj) and objectp(gPanoCallBackFactory) then
  121.     gPanoMovieObj(mSetMouseOverCallback, gPanoCallBackFactory, EMPTY)
  122.     gPanoMovieObj(mSetRolloverCallback, gPanoCallBackFactory, "SampleRolloverHandler")
  123.     gPanoMovieObj(mSetMouseDownCallback, gPanoCallBackFactory, EMPTY)
  124.     gPanoMovieObj(mSetPanZoomStartCallback, gPanoCallBackFactory, EMPTY)
  125.     gPanoMovieObj(mSetMouseStillDownCallback, gPanoCallBackFactory, EMPTY)
  126.     gPanoMovieObj(mSetNodeLeaveCallback, gPanoCallBackFactory, EMPTY)
  127.   end if
  128. end
  129.  
  130. on ShowPanoMovie256 pQuality
  131.   if objectp(gPanoMovieObj) then
  132.     if not voidp(pQuality) then
  133.       gPanoMovieObj(mSetQuality, string(pQuality))
  134.     end if
  135.     gPanoMovieObj(mUpdate)
  136.   end if
  137. end
  138.  
  139. on SetPanoNode256 pNodeID, pUpdate, pQuality
  140.   if objectp(gPanoMovieObj) then
  141.     if not voidp(pNodeID) then
  142.       gPanoMovieObj(mSetNodeID, integer(pNodeID))
  143.     end if
  144.     if not voidp(pQuality) then
  145.       gPanoMovieObj(mSetQuality, string(pQuality))
  146.     end if
  147.     if pUpdate then
  148.       gPanoMovieObj(mUpdate)
  149.     end if
  150.   end if
  151. end
  152.  
  153. on SwingPanoMovie256 pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality
  154.   if objectp(gPanoMovieObj) then
  155.     gPanoMovieObj(mSetZoomAngle, string(pZoom))
  156.     gPanoMovieObj(mSetVPanAngle, string(pVPan))
  157.     gPanoMovieObj(mSetHPanAngle, string(pHPan))
  158.     gPanoMovieObj(mSetQuality, string(pSwingQuality))
  159.     gPanoMovieObj(mSetTransitionMode, "swing")
  160.     gPanoMovieObj(mSetTransitionSpeed, string(pSwingSpeed))
  161.     gPanoMovieObj(mUpdate)
  162.     gPanoMovieObj(mSetTransitionMode, "normal")
  163.     if pFinalQuality <> pSwingQuality then
  164.       gPanoMovieObj(mSetQuality, string(pSwingQuality))
  165.       gPanoMovieObj(mUpdate)
  166.     end if
  167.   end if
  168. end
  169.  
  170. on SetPanoMovieView256 pHPan, pVPan, pZoom, pQuality
  171.   if objectp(gPanoMovieObj) then
  172.     gPanoMovieObj(mSetZoomAngle, string(pZoom))
  173.     gPanoMovieObj(mSetVPanAngle, string(pVPan))
  174.     gPanoMovieObj(mSetHPanAngle, string(pHPan))
  175.     if not voidp(pQuality) then
  176.       gPanoMovieObj(mSetQuality, string(pQuality))
  177.     end if
  178.     gPanoMovieObj(mUpdate)
  179.   end if
  180. end
  181.  
  182. on ClosePanoMovie256
  183.   if objectp(gPanoMovieObj) then
  184.     gPanoMovieObj(mdispose)
  185.   end if
  186. end
  187.  
  188. on PanoFrameScript256 pSpriteNum
  189.   if rollOver(pSpriteNum) then
  190.     if objectp(gPanoMovieObj) then
  191.       set tMouseOverResult to gPanoMovieObj(mMouseOver)
  192.       if tMouseOverResult <> 0 then
  193.         set tAction to item 1 of tMouseOverResult
  194.         set tHotSpotID to item 2 of tMouseOverResult
  195.         if tAction = "jump" then
  196.           set gVR.CurrentNodeID to string(tHotSpotID)
  197.         else
  198.           if tAction = "stil" then
  199.             set gVR.CurrentHotSpotID to string(tHotSpotID)
  200.           else
  201.             if tAction = "navg" then
  202.               set gVR.CurrentHotSpotID to string(tHotSpotID)
  203.               set tViewAngles to gPanoMovieObj(mGetNavgViewAngles)
  204.               set tFileName to gPanoMovieObj(mGetHotSpotName)
  205.               OpenNavMovie(gPathName & "\" & tFileName, 2, 0)
  206.               if objectp(gNavMovieObj) then
  207.                 set gPanoFrame to marker(0)
  208.                 go("Object From Pano")
  209.                 SetNavMovieView(item 1 of tViewAngles, item 2 of tViewAngles)
  210.                 ShowNavMovie()
  211.               end if
  212.             else
  213.               if tAction = "misc" then
  214.                 set gVR.CurrentHotSpotID to string(tHotSpotID)
  215.               else
  216.                 if tAction = "undf" then
  217.                   set gVR.CurrentHotSpotID to string(tHotSpotID)
  218.                   if tHotSpotID = 1 then
  219.                     set gVR to 0
  220.                     swingPyramid()
  221.                     advanceVR("Pyramid")
  222.                   else
  223.                     if tHotSpotID = 2 then
  224.                       set gVR to 1
  225.                       swingShip()
  226.                       advanceVR("Ship")
  227.                     end if
  228.                   end if
  229.                 else
  230.                   if tAction = "pan " then
  231.                   end if
  232.                 end if
  233.               end if
  234.             end if
  235.           end if
  236.         end if
  237.         set gLastTimeRollover to 1
  238.       else
  239.         cursor(200)
  240.         cursor(-1)
  241.         set gLastTimeRollover to 0
  242.       end if
  243.     end if
  244.   else
  245.     if gLastTimeRollover then
  246.       cursor(200)
  247.       cursor(-1)
  248.       set gLastTimeRollover to 0
  249.       if objectp(gPanoMovieObj) then
  250.         gPanoMovieObj(mIdle)
  251.       end if
  252.     end if
  253.   end if
  254. end
  255.  
  256. on ExtractPathName256 pPathName
  257.   set tDelimiter to "\"
  258.   if pPathName contains tDelimiter then
  259.     set tCharPos to length(pPathName)
  260.     repeat while tCharPos >= 1
  261.       if char tCharPos of pPathName = tDelimiter then
  262.         return char 1 to tCharPos - 1 of pPathName
  263.       end if
  264.       set tCharPos to tCharPos - 1
  265.     end repeat
  266.     return EMPTY
  267.   else
  268.     return EMPTY
  269.   end if
  270. end
  271.  
  272. factory TestCallbacks
  273. method TestMouseOverHandler
  274.   if objectp(gPanoMovieObj) then
  275.     set gVR.MouseOverHandler.Message to "In mouse over at: " & the ticks
  276.   end if
  277.  
  278. method TestRolloverHotSpotHandler pHotSpotID
  279.   if objectp(gPanoMovieObj) then
  280.     set gVR.RolloverHotSpotHandler.Message to "Rolling over hot spot: " & pHotSpotID
  281.   end if
  282.  
  283. method TestMouseDownHandler
  284.   if objectp(gPanoMovieObj) then
  285.     set gVR.MouseDownHandler.Message to "In mouse down at: " & the ticks
  286.     gPanoMovieObj(mPassMouseDown)
  287.   end if
  288.  
  289. method testPanZoomStartHandler
  290.   if objectp(gPanoMovieObj) then
  291.     set gVR.PanZoomStartHandler.Message to "In pan zoom start at: " & the ticks
  292.   end if
  293.  
  294. method TestMouseStillDownHandler
  295.   if objectp(gPanoMovieObj) then
  296.     set gVR.MouseStillDownHandler.Message to "In mouse still down at: " & the ticks
  297.     set gVR.MouseStillDownHandler.Message to gPanoMovieObj(mGetHPanAngle)
  298.   end if
  299.  
  300. method TestNodeLeaveHandler pToNode
  301.   if objectp(gPanoMovieObj) then
  302.     set gVR.NodeLeaveHandler.Message to "Leaving node ID: " & pToNode
  303.   end if
  304.  
  305. factory SampleCallbacks
  306. method SampleMouseOverHandler
  307.   put "Mouse over panoramic movie"
  308.   if objectp(gPanoMovieObj) then
  309.   end if
  310.  
  311. method SampleRolloverHandler pHotSpotID
  312.   set gVR.CurrentHotSpotID to string(pHotSpotID)
  313.  
  314. method SampleMouseDownHandler
  315.   put "Mouse down during mMouseOver call"
  316.   if objectp(gPanoMovieObj) then
  317.     gPanoMovieObj(mPassMouseDown)
  318.   end if
  319.  
  320. method SamplePanZoomStartHandler
  321.   put "About to pan or zoom in panoramic movie"
  322.  
  323. method SampleMouseStillDownHandler
  324.   put "Enter mouse still down from panoramic movie"
  325.   if objectp(gPanoMovieObj) then
  326.   end if
  327.   put "Leave mouse still down from panoramic movie"
  328.  
  329. method SampleNodeLeaveHandler pToNode
  330.   put "Jumping to node " & pToNode & " in panoramic movie"
  331.